package com.springboot.context;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author yexi
 */
@Component
@Slf4j
public class ApplicationRunnerDemo2 implements ApplicationRunner {

    static {
        System.out.println("ApplicationRunnerDemo2已载入内存");
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println("ApplicationRunner: 在SpringApplication运行时会执行的代码2");
    }
}
